<template>
	<view>

		<view class="h-44  flex fixed-top box-c b-bottom-e bg-color-w" :style="{'padding-top': getStorage('top')+'px'}">
			<slot name="left">
				<view  @click="back(1)" v-if="isBack" class="flex f-s-0 padding-lr10 f-a-c f-j-c   f20-size">
					<image class="w-18" src="../../static/images/back.png" mode="widthFix"></image>
				</view>
				<view class="padding-15" v-else></view>
			</slot>
			<slot name="center">
			<view class="flex flex-1 f-a-c f-j-c f16-size">
				{{text}}
			</view>
			</slot>
			<slot name="right">
				<!-- #ifndef MP-WEIXIN -->
				<view @click="goUser" class="padding-lr10 flex f-a-c">
					<image class="w-24" src="../../static/images/user.png" mode="widthFix"></image>
				</view>
				<!-- #endif -->
			</slot>
			<!-- #ifdef MP-WEIXIN -->
			<view class="flex f-s-0" style="width: 180upx;"></view>
			<!-- #endif -->
		</view>
		<view v-if="isShow" class="h-44 box-c" :style="{'padding-top': getStorage('top')+'px'}"></view>
	</view>
</template>
<style scoped>
</style>
<script>
	const $ = require('../../utils/api.js');
	let self = this;
	export default {
		props:{
			isShow: {//默认占位高度
				type: Boolean,
				default: true,
			},
			isBack: {
				type: Boolean,
				default: true,
			},
			text: {
				type: String,
				default:'TKShop'
			}
		},
		components: {},
		data() {
			return {
			};
		},
		onLoad: function(options) {
			self = this;
			this.init();
		},
		onShow() {
		},
		methods: {
			goUser() {
				let token = uni.getStorageSync('token') ? uni.getStorageSync('token') : '';
				if(token == '') {
					$.go('/pages/index/login');
				}else{
					$.go('/pages/index/orderList');
				}
			},
			init() {},
		},
		computed: {},
		created() {
			self = this;
		},
		mounted() {},
		destroyed() {},
		onPullDownRefresh() {
		},
		onReachBottom() {
			
		}
	}
</script>